package com.chen.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chen.gulimall.ware.vo.WareSkuLockVo;
import com.chen.gulimallcommon.common.to.HasStockTo;
import com.chen.gulimallcommon.common.to.OrderTo;
import com.chen.gulimallcommon.common.to.mq.StockLockedTo;
import com.chen.gulimallcommon.common.utils.PageUtils;
import com.chen.gulimall.ware.entity.WareSkuEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author mr.chen
 * @email 3061634906@qq.com
 * @date 2022-04-19 18:33:47
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<HasStockTo> hasStock(List<Long> skuIds);

    boolean orderLockStock(WareSkuLockVo vo);

    void unlockStock(StockLockedTo to);

    void unlockStock2(OrderTo orderTo);
}

